﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using PJ.DBModel.Models;
using System;
using System.Collections.Generic;
using System.Text;

namespace PJ.DBModel.Mappings
{
    public class UsersMap : IEntityTypeConfiguration<Users>
    {
        public void Configure(EntityTypeBuilder<Users> builder)
        {
            builder.ToTable("users");

            builder.HasComment("用户表");

            builder.Property(e => e.Id).HasComment("主键");

            builder.Property(e => e.Account)
                .HasMaxLength(50)
                .HasComment("账户");

            builder.Property(e => e.Birthday).HasComment("生日");

            builder.Property(e => e.CreateTime).HasComment("创建时间");

            builder.Property(e => e.CreateUserId).HasComment("创建用户主键");

            builder.Property(e => e.DepartmentId).HasComment("部门主键");

            builder.Property(e => e.Email)
                .HasMaxLength(50)
                .HasComment("邮箱");

            builder.Property(e => e.EnabledMark).HasComment("有效标志");

            builder.Property(e => e.Gender).HasComment("性别");

            builder.Property(e => e.HeadIcon)
                .HasMaxLength(50)
                .HasComment("头像");

            builder.Property(e => e.MobilePhone)
                .HasMaxLength(50)
                .HasComment("手机");

            builder.Property(e => e.RealName)
                .HasMaxLength(50)
                .HasComment("姓名");

            builder.Property(e => e.RoleId).HasComment("角色主键");

            builder.Property(e => e.UpdateTime).HasComment("修改时间");

            builder.Property(e => e.UpdateUserId).HasComment("修改用户主键");

            builder.Property(e => e.UserPassword)
                .HasMaxLength(50)
                .HasComment("密码");

            builder.Property(e => e.WeChat)
                .HasMaxLength(50)
                .HasComment("微信");
        }
    }
}
